home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / Emulation_Include_Files / notify.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  7.1 KB  |  174 lines

  1. /*++
  2.  
  3. Copyright (c) 1995-1998 Microsoft Corporation
  4.  
  5. Module Name:Notify.h
  6.  
  7. Purpose:Public Header for User Notifications
  8.  
  9. --*/
  10.  
  11. #ifndef _NOTIFY_H_
  12. #define _NOTIFY_H_
  13.  
  14. // @doc NOTIFY
  15.  
  16. /*
  17.  * Parameters to the CeRunAppAtEvent() API.
  18.  */
  19.  
  20. #define NOTIFICATION_EVENT_NONE                 0
  21. #define NOTIFICATION_EVENT_TIME_CHANGE          1
  22. #define NOTIFICATION_EVENT_SYNC_END             2
  23. #define NOTIFICATION_EVENT_ON_AC_POWER          3
  24. #define NOTIFICATION_EVENT_OFF_AC_POWER         4
  25. #define NOTIFICATION_EVENT_NET_CONNECT          5
  26. #define NOTIFICATION_EVENT_NET_DISCONNECT       6
  27. #define NOTIFICATION_EVENT_DEVICE_CHANGE        7
  28. #define NOTIFICATION_EVENT_IR_DISCOVERED        8
  29. #define NOTIFICATION_EVENT_RS232_DETECTED       9
  30. #define NOTIFICATION_EVENT_RESTORE_END         10
  31.  
  32. /*
  33.  * String passed on the command line when an app is run as the result
  34.  * of a call to CeRunAppAtTime().
  35.  */
  36.  
  37. #define APP_RUN_AT_TIME                 TEXT("AppRunAtTime")
  38.  
  39. /*
  40.  * Prefix of the command line when the user requests to run the application
  41.  * that "owns" a notification.  It is followed by a space, and the
  42.  * stringized version of the notification handle.
  43.  */
  44.  
  45. #define APP_RUN_TO_HANDLE_NOTIFICATION  TEXT("AppRunToHandleNotification")
  46.  
  47. /*
  48.  * Strings passed on the command line when an event occurs that the
  49.  * app has requested via CeRunAppAtEvent.  Note that some of these
  50.  * strings will be used as the command line *prefix*, since the rest
  51.  * of the command line will be used as a parameter.
  52.  */
  53.  
  54. #define APP_RUN_AFTER_TIME_CHANGE       TEXT("AppRunAfterTimeChange")
  55. #define APP_RUN_AFTER_SYNC              TEXT("AppRunAfterSync")
  56. #define APP_RUN_AT_AC_POWER_ON          TEXT("AppRunAtAcPowerOn")
  57. #define APP_RUN_AT_AC_POWER_OFF         TEXT("AppRunAtAcPowerOff")
  58. #define APP_RUN_AT_NET_CONNECT          TEXT("AppRunAtNetConnect")
  59. #define APP_RUN_AT_NET_DISCONNECT       TEXT("AppRunAtNetDisconnect")
  60. #define APP_RUN_AT_DEVICE_CHANGE        TEXT("AppRunDeviceChange")
  61. #define APP_RUN_AT_IR_DISCOVERY         TEXT("AppRunAtIrDiscovery")
  62. #define APP_RUN_AT_RS232_DETECT         TEXT("AppRunAtRs232Detect")
  63. #define APP_RUN_AFTER_RESTORE           TEXT("AppRunAfterRestore")
  64.  
  65. /*
  66.  * Strings passed on the end of the command line for the event,
  67.  * NOTIFICATION_EVENT_DEVICE_CHANGE.  The general form will be
  68.  * "/op devicename" for instance "/ADD COM2:"
  69.  */
  70. #define NOTIFY_DEVICE_ADD               TEXT("/ADD")
  71. #define NOTIFY_DEVICE_REMOVE            TEXT("/REMOVE")
  72.  
  73. /*
  74.  * @struct CE_USER_NOTIFICATION | User Notification Structure
  75.  *
  76.  * @comm  This structure is passed in to <f CeGetUserNotificationPreferences>.
  77.  * Initial settings are used to populate the dialog.  If the function
  78.  * returns TRUE, the returned settings should be saved, and considered when
  79.  * calling <f CeSetUserNotification>.  Settings for hardware not on the
  80.  * current device will be ignored.
  81.  *
  82.  * It is also used when calling <f CeSetUserNotification>, to describe
  83.  * what should happen when the notification time is reached.  
  84.  */
  85.  
  86. typedef struct UserNotificationType {
  87.     DWORD ActionFlags;      //@field Action Flags.  Any combination of the
  88.                             // PUN_* flags.  Flags not valid on a given
  89.                             // hardware platform will be ignored.
  90. #define PUN_LED     1       //@flag PUN_LED | LED flag.  Set if the LED should be 
  91.                             // flashed when the notification occurs.
  92. #define PUN_VIBRATE 2       //@flag PUN_VIBRATE | Vibrate flag.  Set if the device should
  93.                             // be vibrated.
  94. #define PUN_DIALOG  4       //@flag PUN_DIALOG | Dialog flag.  Set if a dialog should be
  95.                             // displayed (the app must provide title and text
  96.                             // when calling <f CeSetUserNotification>).
  97. #define PUN_SOUND   8       //@flag PUN_SOUND | Sound flag.  Set if the sound specified
  98.                             // in pwszSound should be played.
  99. #define PUN_REPEAT 16       //@flag PUN_REPEAT | Sound repeat flag.  Set if the sound
  100.                             // specified in pwszSound should be repeated
  101.                             // for a short period of time.
  102.     TCHAR *pwszDialogTitle; //@field Dialog Title.  If NULL, no dialog will
  103.                             // be displayed.  Ignored by
  104.                             // CeGetUserNotificationPreferences().
  105.     TCHAR *pwszDialogText;  //@field Dialog Text.  Ignored if Dialog Title is
  106.                             // NULL.  Ignored by
  107.                             // CeGetUserNotificationPreferences().
  108.     TCHAR *pwszSound;       //@field Sound string.  The unqualified (system 
  109.                             // media directory implied) name of a sound file
  110.                             // to play.  CeSetUserNotification() ignores if
  111.                             // PUN_SOUND is not set.
  112.     DWORD nMaxSound;        //@field Max Sound string length.  Specifies the
  113.                             // maximum length of the string that can be copied
  114.                             // into the pwszSound buffer by
  115.                             // CeGetUserNotificationPreferences().  In a 
  116.                             // future release this may be a pathname, so the 
  117.                             // buffer passed in must be at least PATH_MAX *
  118.                             // sizeof(TCHAR)) long.  Ignored by
  119.                             // CeSetUserNotification().
  120.     DWORD dwReserved;       //@field Reserved.  Must be NULL.  In future 
  121.                             // versions, this may point at an expansion
  122.                             // structure.  The first dword of the structure
  123.                             // will indicate the size of the structure.
  124. } CE_USER_NOTIFICATION, *PCE_USER_NOTIFICATION;
  125.  
  126. /* Declarations of User Notification APIs. */
  127.  
  128. #ifdef __cplusplus
  129. extern "C" {
  130. #endif //__cplusplus
  131.  
  132. // @CESYSGEN IF GWES_NOTIFY
  133.  
  134. #ifdef _WIN32_WCE_EMULATION
  135. HANDLE WINAPI CeSetUserNotification (HANDLE hNotification, TCHAR *pwszAppName, SYSTEMTIME *lpTime, PCE_USER_NOTIFICATION lpUserNotification);
  136.  
  137. BOOL WINAPI CeClearUserNotification (HANDLE hNotification);
  138.  
  139. BOOL WINAPI CeRunAppAtTime (TCHAR *pwszAppName, SYSTEMTIME *lpTime);
  140.  
  141. BOOL WINAPI CeRunAppAtEvent(TCHAR *pwszAppName, LONG lWhichEvent);
  142.  
  143. BOOL WINAPI CeHandleAppNotifications (TCHAR *pwszAppName);
  144.  
  145. BOOL WINAPI CeGetUserNotificationPreferences (HWND hWndParent, PCE_USER_NOTIFICATION lpNotification);
  146. #else
  147. HANDLE CeSetUserNotification (HANDLE hNotification, TCHAR *pwszAppName, SYSTEMTIME *lpTime, PCE_USER_NOTIFICATION lpUserNotification);
  148.  
  149. BOOL CeClearUserNotification (HANDLE hNotification);
  150.  
  151. BOOL CeRunAppAtTime (TCHAR *pwszAppName, SYSTEMTIME *lpTime);
  152.  
  153. BOOL CeRunAppAtEvent(TCHAR *pwszAppName, LONG lWhichEvent);
  154.  
  155. BOOL CeHandleAppNotifications (TCHAR *pwszAppName);
  156.  
  157. BOOL CeGetUserNotificationPreferences (HWND hWndParent, PCE_USER_NOTIFICATION lpNotification);
  158. #endif
  159.  
  160. // @CESYSGEN ENDIF
  161.  
  162. #ifdef __cplusplus
  163. }
  164. #endif  //__cplusplus
  165.  
  166. #ifdef WINCEOEM
  167. #include <pnotify.h>
  168. #ifdef WINCEMACRO
  169. #include <mnotify.h>    // internal defines 
  170. #endif
  171. #endif
  172.  
  173. #endif /* _NOTIFY_H_ */
  174.